package com.kermel.andromeda.engine;

import com.kermel.andromeda.engine.mock.MockCurrentTimeSubscriber;
import com.kermel.common.util.ThreadUtil;

import android.test.AndroidTestCase;

public class CurrentTimeTickerTest extends AndroidTestCase {
    private CurrentTimeTicker ticker;
    private MockCurrentTimeSubscriber subscriber;
    
    protected void setUp() throws Exception {
        super.setUp();
        
        subscriber = new MockCurrentTimeSubscriber();
        ticker = new CurrentTimeTicker(subscriber);
    }

    protected void tearDown() throws Exception {
        super.tearDown();
    }
    
    public void testCurrentTimeTickerSubscriberNotNull() {
        assertNotNull(ticker.getSubscriber());
    }
    
    public void testCurrentTimeTickerSendsNotification() {
        ThreadUtil.pauseForSeconds(3);
        assertTrue(subscriber.isNotificationReceived());
    }
    
    
}
